from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time

browser = webdriver.Chrome()
browser.get('https://www.12306.cn/index/')
id_word_from = "fromStationText"
id_word_to = "toStationText"
#
locator_from = (By.ID, id_word_from)
#
locator_to = (By.ID, id_word_to)

wait = WebDriverWait(browser, 10).until(EC.presence_of_element_located(locator_from))

input = browser.find_element_by_id(id_word_from)
input.clear()
input.send_keys("贵州")
wait = WebDriverWait(browser, 10).until(EC.presence_of_element_located(locator_to))
input = browser.find_element_by_id(id_word_to)
input.clear()
input.send_keys("厦门")
time.sleep(3)
browser.close()